<ul class="categories">
  <% root.children.each do |category| %>
    <li><label><%= category.presentation %>

      <% unless category.children.blank? %>
        </label><%= render "categories", :root => category %>
      <% else %>
        <%= check_box_tag "product[category_ids][]", category.id, @product.categories.include?(category) %></label>
      <% end %>
    </li>
  <% end %>
</ul>